package graduationorder.graduationorder.error;
/**
 * @author Mzk
 * @description: 通用错误接口
 * @date: 2024/7/14 下午 5:54
 */
public enum EmBusinessException implements CommonError{

    SERVER_ERROR(500,"服务器异常"),
    PARAMETER_VALIDATION_ERROR(10001,"参数异常"),
    USER_NON_EXISTENT(10002,"用户不在"),
    USER_AUTHORIZATION_EXCEPTION(20000,"用户认证异常"),
    ;

    private Integer errorCode;
    private String errorMsg;

    EmBusinessException(Integer errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }


    @Override
    public Integer getErrorCode() {
        return this.errorCode;
    }

    @Override
    public String getErrorMsg() {
        return this.errorMsg;
    }

    @Override
    public CommonError setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
        return this;
    }
}
